<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>绁星灯酱</title>
    <link rel="shortcut icon" href="static/imgs/fav.ico" type="image/x-icon" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css">
    <style>
        .he {
            height: 520px;
            position: relative;
            overflow: hidden;
        }

        .he > div {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;

            --offset: 0px;
            --blur: 2px;
        }

        .he > div > img {
            display: block;
            width: 100%;
            height: 50%;
            object-fit: cover;

            transform: translateX(var(--offset));
            filter: blur(var(--blur));
        }

    </style>
    <style>
        .footer{
            position: absolute;  bottom: 0; /* 关键 */
            left:40%; /* IE下一定要记得 */
            height: 60px;         /* footer的高度一定要是固定值*/
        }
    </style>
<script src="https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/autoload.js"></script>
</head>
<body>
<div>
    <div class="he">
        <div><img src="static/imgs/head/h1.png"></div>
        <div><img src="static/imgs/head/h2.png"></div>
        <div><img src="static/imgs/head/h3.png"></div>
        <div><img src="static/imgs/head/h4.png"></div>
        <div><img src="static/imgs/head/h5.png"></div>
        <div><img src="static/imgs/head/h6.png"></div>
    </div>

    <div class="footer">
        <a href="https://beian.miit.gov.cn/">
            <div>
                <div style="display: inline-block">
                    <p6>绁星灯酱</p6>
                </div>
                <div style="display: inline-block">
                    <img src="static/imgs/gongan.png">
                </div>
                <div style="display: inline-block">
                    <h3>粤ICP备2020110507号</h3>
                </div>


            </div>
        </a>

    </div>

</div>
</body>

<script type="text/javascript">
    const images = document.querySelectorAll('.he > div > img');
    document.querySelector('.he').addEventListener('mousemove', (e) => {
        let percentage = e.clientX / window.outerWidth;
        // console.log(percentage);
        let offset = 10 * percentage;
        let blur = 20;
        for (let [index, image] of images.entries()) {
            offset *= 1.3;

            let blurValue = (Math.pow((index / images.length - percentage), 2) * blur)

            image.style.setProperty('--offset', `${offset}px`);
            image.style.setProperty('--blur', `${blurValue}px`);

        }
    })


</script>
</html>
